Version 3.0
User's Guide

Commands: Time and Date

Previous | Next
Contents

<INSERT_TIME offset format>

INSERT_TIME will place the current time, as text, into your document. The time will be formatted using the time format set in the Date & Time control panel. The time will be inserted in either short or long form according to the current time format setting (See "Configuring NetCloak" later in this User's Guide).

The offset and format parameters are both optional, but if both are specified, the offset must come first.

The offset parameter is a positive or negative number that specifies the fractional number of hours difference between the time set on the Web server and the time that should be displayed. In other words, an offset of +2.5 will display the current time plus two and a half hours. An offset of -4 would display the time less four hours. This can be used to show times that vary between time zones.

For Example:

    The time in Chicago is <INSERT_TIME>.
    The time in California is <INSERT_TIME -2>.
    The Time in New York is <INSERT_TIME +1>.

A plus ("+") or minus ("-") sign is always required when specifying an offset.

The format parameter allows you to override the current time format setting. Valid values for this parameter are either "SHORT" (for the short time format) or "LONG" (for the long time format).

Here is an example:

    The current time is <INSERT_TIME LONG>.

In this case, the time will be inserted into the page, and will include seconds.

<HIDE_TIME operator time1 time2 ...>
<SHOW_TIME operator time1 time2 ...>

The HTML text that follows the HIDE_TIME command will be hidden during time intervals that meet the criteria of the specified comparison operator. Similarly, text following SHOW_TIME will be shown when the current time meets the comparison criteria.

The comparison operator parameter is optional. If omitted, the default is to perform a "begins with" text comparison.

Hours are specified as on a 24-hour clock. For example:

    <HIDE_TIME 21>

This will hide text following it for the one hour interval between 9:00:00 PM and 9:59:59 PM. Leading zeros for single digits are required, and multiple times may be specified.

If a text comparison operator is specified, the current time will be compared to the time parameters as a text value. For example, to hide text during the 2nd half hour of every hour, you could write (assuming the short time format is in use):

    <HIDE_TIME CONTAINS ":3*" ":4*" ":5*">

If a numeric comparison operator is specified, the current time is compared to the time parameters as a number, by converting them each to the number of seconds since the "beginning of time" according to the MacOS. Therefore, you can hide text during certain hours of the day. For example, to hide text before noon, you can write:

    <HIDE_TIME LT 12:00>

<INSERT_DATE offset format>

The INSERT_DATE command will place the current date, as text, into your document at the specified point.

The optional offset parameter allows you to display the date offset from the date and time set on the server. This is useful for displaying the date in another time zone. The offset must be preceded by a "+" for a forward offset or "-" for a backwards offset, and is specified in hours and tenths of hours. For example,

    Today is <INSERT_DATE>    In 30 minutes it will be <INSERT_DATE +.5>    And yesterday was <INSERT_DATE -24>

The format of the date that NetCloak inserts will depend upon the date format you have selected in the Date & Time control panel, as well as the current date format setting. See the section "Configuring NetCloak" for more information.

You can override the default date format setting by specifying either "SHORT" or "LONG" as the "format" parameter. The Date & Time control panel allows you to configure two date formats: a Long Date format and a Short Date format, and the "format" parameter allows you to select which should be used to display the date. The format may be specified without specifying an offset.

Here is an example:

    The current date is <INSERT_DATE SHORT>.
    Tomorrow will be <INSERT_DATE +24 SHORT>.

This will display the current date with the Short Date format specified in the Date & Time control panel. For the U.S. default date format, this will result in:

    The current date is 10/31/97.
    Tomorrow will be 11/1/97.

<HIDE_DATE operator date1 date2 ...> OR
<HIDE_DATE beginDate endDate>
<SHOW_DATE operator date1 date2 ...> OR
<SHOW_DATE beginDate endDate>

HIDE_DATE allows you to hide portions of your page during the specified dates. SHOW_DATE allows you to show portions of your page during the specified dates.

When using numeric comparison operators or "begin" and "end" dates, the date parameters must be specified using the short date format configured in your system's Date & Time control panel. In the US, this format is usually set to "mm/dd/yy". Partial dates, such as "1997", "11/98" or "04/15", and wildcards within date values, are not allowed. Leading zeros for single-digit months or days are optional, as are the century digits of the year.

If the first parameter following "HIDE_DATE" or "SHOW_DATE" in the tag is a comparison operator, then text is hidden/shown if the current date satisfies the comparison to any of the remaining date parameters.

For example, to hide text during all of 1997 and 1998 using comparison operators, you could write:

    <HIDE>    <SHOW_DATE LT 1/1/97>    <SHOW_DATE GT= 1/1/99>    This will be hidden during 1997 and 1998.
    <SHOW>

If the date formats on your server are configured to always include the century digits, you could also use:

    <SHOW><HIDE_DATE CONTAINS "1997" "1998">    This will be hidden during 1997 and 1998.
    <SHOW>

To display a message only a certain day of any year, you could use (assuming a U.S. short date format):

    <HIDE><SHOW_DATE BEGINS "12/25">    Merry Christmas!
    <SHOW>

If the first parameter is not a comparison operator, then the two parameters define a date range, and text will be hidden from the begin date until the end date. To work properly, the begin date must be before the end date. Only one begin and end date may be specified.

To suppress part of a page during 1998 this way, you could use:

    <SHOW><HIDE_DATE 1/1/98 1/1/99>    This will be hidden during 1998.
    <SHOW>

A single asterisk (*) can be used as the begin date to mean "any date earlier than". Using an asterisk for the end date means "any date after". An example is shown below, and another is included in the INSERT_COUNTDOWN section later.

NetCloak allows you to easily hide or show a section of a page on any single date, by simply omitting the end date parameter. In this case, NetCloak assumes an end date exactly 24 hours from the start date. For example:

    <HIDE><SHOW_DATE 12/14/98>    Happy Birthday, John!
    <SHOW>

NetCloak does take the time of day into account when the HIDE/SHOW_DATE command is used. You can include a specific time of day by following the date with an "at sign" ('@') and the time. For example,:

    <SHOW><HIDE_DATE * 12/14/98@5:34>    Hidden until 12/14/98 at 5:34 a.m. 
    <SHOW>

It is important to note that when dates are specified without a time, the time is actually computed as midnight on the morning of the date specified. In other words, a date of "1/1/98" technically specifies the stroke of midnight on New Year's eve, at the end of 1997 and the beginning of 1998. So "1/1/98" and "12/31/97@24:00" refer to the exact same time.

Because of this, using the numeric equality operator '==' will make the comparison including the time, even though it is not explicitly specified. This results in text being shown or hidden for one second at the specified date and time, so you typically do not want to use it with SHOW/HIDE_DATE commands. In other words, this:

    <HIDE><SHOW_DATE == 12/25/98>

...is not equivalent to this:

    <HIDE><SHOW_DATE 12/25/98>

The first shows text for one second at midnight; the second shows text for 24 hours.

<INSERT_COUNTDOWN_WDHM date@time "Weeks" "Days" "Hours" "Minutes">

Counting down to a specified day or time is handy when you have some event approaching that you would like to highlight. For example, you might want to count down the days until a big sale, or a mid-term exam, or the roll out of a new feature of your Web site. Using the command is simple, just include the command and specify the date (and optionally the time) you would like to countdown to. For example:

    The new century starts in <INSERT_COUNTDOWN_WDHM 01/01/2000>.

The INSERT_COUNTDOWN command has several variations, specified by the "WDHM" at the tail end of the command. The letters "WDHM" stand for "Weeks", "Days", "Hours", and "Minutes".

Any combination of these characters are allowed, and they give you control over exactly what is displayed. For example, to countdown the hours until Christmas of 1998, you would use:

    Christmas '98 is in <INSERT_COUNTDOWN_H 12/25/1998>.

You may also countdown to a specific time (with time expressed in military format), as in:

    I'll have Thanksgiving dinner in <INSERT_COUNTDOWN_M 11/28/1998@16:00>    <P>    Too many minutes?  How about <INSERT_COUNTDOWN_DM 11/28/98@16:00>?

Valid dates are between January 1st, 1904 and January 1st, 2030.

Also, the INSERT_COUNTDOWN command will also count up, if the date (and/or time) specified is in the past.

For example:

    My son is <INSERT_COUNTDOWN_WD 5/6/93> old, and my daughter is 
    <INSERT_COUNTDOWN_WD 12/2/94> old.

By default, NetCloak uses the labels "Weeks", "Days", "Hours" and "Minutes" when displaying the countdown. In the example above, the page would appear:

    My son is 231 Weeks 5 Days old, and my daughter is 
    149 Weeks 4 Days old.

However, you can change the labels by specifying the label parameters. If you choose to include your own labels, you should specify all four, in order. In the example above, we can use lower case labels and include a comma after "weeks" by changing the command to:

    My son is <INSERT_COUNTDOWN_WD 5/6/93 "weeks," "days" "hours" "minutes"> old, and my daughter is <INSERT_COUNTDOWN_WD 12/2/94 "weeks," "days" "hours" "minutes"> old.

Notice that even though hours and minutes won't be displayed, they are included for good form and consistency.

To avoid having the counter reverse itself and begin counting upward, you may want to use the SHOW_DATE and HIDE_DATE commands. For example:

    <HIDE><SHOW_DATE LT 12/25/98>    Christmas is in
    <INSERT_COUNTDOWN_WDH 12/25/98>.
    <HIDE><SHOW_DATE 12/25/98>    Merry Christmas!
    <HIDE><SHOW_DATE GT= 12/26/98>    Christmas is in
    <INSERT_COUNTDOWN_WDH 12/25/99>.
    <SHOW>

<INSERT_DAY offset>

The INSERT_DAY command will place the current day of the week, as text, into your document. NetCloak will insert the day in the format selected in the Date & Time control panel. Here is an example:

    Today is <INSERT_DAY>.

For U.S. date format, this would appear in the page like this:

    Today is Friday.

As in the INSERT_DATE and TIME commands, the "offset" parameter is an optional parameter that specifies a number of hours and tenths to offset the day. Note that the offset is not specified in days, because you may want to show the day in a different time zone. Only one offset may be specified.

<HIDE_DAY operator day1 day2 ...>
<SHOW_DAY operator day1 day2 ...>

HIDE_DAY hides the HTML text on the specified day(s). SHOW_DAY shows the HTML text following it on the specified day(s).

The comparison operator is optional. If omitted, a "begins with" comparison is used.

The days are specified as the first three characters of the day, and depend on the date format selected in the Date & Time control panel on the server. For U.S. format, the valid days are MON, TUE, WED, THU, FRI, SAT, SUN. As with most other commands, multiple days may be specified.

This example will hide text during the work week:

    <HIDE_DAY MON TUE WED THU FRI>


Copyright © 1996-1999 Maxum Development Corporation

http://www.maxum.com/
Previous | Next
Contents